// 右上 圆环图
$.get('http://127.0.0.1:5000/task7').done(function (data) {
    var myeCharts = echarts.init(document.querySelector('.panel .pie2'))
    option = {
        color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc', '#00FFFF', '#00FF00', '#FFE4B5'],
        title: {
            text: '商品种类最多的商品类型:' + data.name,
            textStyle: {
                color: 'white',
                // fontSize: 18,
            }
        },
        legend: {
             type: 'scroll', //分页类型
             orient: 'vertical',  //垂直显示
             y: 'center',    //延Y轴居中
             x: 'right', //居右显示
             textStyle: {
                color: 'white',
                fontSize:12,
             }
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        series: [
            {
                name: '商品数',
                type: 'pie',
                radius: ['40%', '85%'],
                center: ['50%', '55%'],
                avoidLabelOverlap: false,
                label: {
                    show: false,
                    position: 'center',
                },
                emphasis: {
                    label: {
                        show: true,
                        fontSize: '40',
                        fontWeight: 'bold'
                    }
                },
                labelLine: {
                    show: false
                },
                data: data.data

            }
        ]
    };
    myeCharts.setOption(option)
})
